//
//  Constant.h
//  INMOTION
//
//  Created by 孙凯旋 on 14-9-23.
//  Copyright (c) 2014年 Inmotion. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>


// 屏幕宽度
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
// 屏幕高度
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
#define iPhoneX (((int)((ScreenHeight/ScreenWidth)*100) == 216)?YES:NO)
#define kIMTNavigationBarHeight (iPhoneX ? 88 : 64)
#define kIMTTabBarHeight (iPhoneX ? 83 : 49)
#define kIMTToolBarHeight (iPhoneX ? 78 : 44)
#define kIMTTopBarOffset (iPhoneX ? 24 : 0)
#define kIMTBottomBarOffset (iPhoneX ? 34 : 0)

#define TABBAR_BEYOND_HEIGHT ([[UIApplication sharedApplication] statusBarFrame].size.height > 20 ? 34 : 0)

#define UUIDIdentifier @"InMotion"

#define APP_KEY @"YK8xQyfQfmiNz3RS"

/***背景颜色定义***/
#define IMTColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define IMTColorAlpha(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]

#define kIMTBlack                        IMTColor(32,32,32)
#define kIMTDefaultBlack                 IMTColor(40,40,40)
#define kIMTDefaultLightBlack            IMTColor(49,49,49)
#define kIMTDefaultBlue                  IMTColor(73,180,231)

#if defined(SOLOWHEEL)
#define kIMTDefaultOrangeColor           IMTColor(211,13,26)
#define kIMTDefaultDarkOrangeColor       IMTColor(211,13,26)    //车辆界面
#else
#define kIMTDefaultOrangeColor           IMTColor(255, 255, 255)        //导航栏颜色
#define kIMTDefaultDarkOrangeColor       IMTColor(255,94,23)    //车辆界面
#endif

#define kIMTDefaultLineColor             IMTColor(230, 230, 230)
#define kIMTDefaultLightLineColor        IMTColor(245, 245, 245)
#define kIMTDefaultBackgroundColor       IMTColor(241, 241, 241)
#define kIMTLightBackgroundColor         IMTColor(250, 250, 250)
#define kIMTDefaultAvatarBackgroundColor IMTColor(239, 239, 244)
#define kIMTDefaultTitleColor            IMTColor(46,46,51)

#define kIMTThemeColor                      IMTColor(51,91,170)// 主题颜色

#define kIMTRedPacketRedColor            IMTColor(236,78,77)
#define kIMTRedPacketGoldColor           IMTColor(225,220,142)



/*乐文*/
#define kIMTDefaultPostUserNameColor     IMTColor(70,70,70)
#define kIMTHighlightedTextColor         IMTColor(35,122,177)

#define kIMTLightDefaultColor            [UIColor lightGrayColor]

//文件路径
#define kIMTDefaultFileDirectory [NSHomeDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"Library/Caches/%@",[[NSBundle mainBundle] bundleIdentifier]]]

// 系统版本
#define IOS10_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)
#define  IOS9_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)
#define  IOS8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
#define  IOS7_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define  IOS6_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0)

#define IPAD ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)

// 判断是否是4英寸设备
#define IPHONE4S_OR_EARLIER ([[UIScreen mainScreen] bounds].size.height < 568.0)

#define kIMTScreenScale [UIScreen mainScreen].scale
#define kIMTScreenWidth [UIScreen mainScreen].bounds.size.width
#define kIMTScreenHeight [UIScreen mainScreen].bounds.size.height
#define kIMT1Pixel (1/kIMTScreenScale)
#define kIMTDefaultBorderWidth kIMT1Pixel

//布局比例
#define IMAutoSizeScaleX [UIScreen mainScreen].bounds.size.width/320.0
//6和plus的导航栏和tabbar高度都和5是一样的
#define IMAutoSizeScaleY ([UIScreen mainScreen].bounds.size.height-103)/(568.0-103)

//Get the status that if user is logoin
#define UserIsLogin [UserModel userIsLogin]

//weakSelf
#define WS(weakSelf) __weak __typeof(&*self)weakSelf =self;


@interface IMTConfig : NSObject

@end
